perm filename DOT.MF[UHF,DEK] blob sn#830814 filedate 1987-01-28 generic text, type T, neo UTF8
% halftone font with 65 levels of gray, characters "0" (white) to "p" (black)

pair p[]; % the pixels in order (first p0 becomes black, then p1, etc)
p0=(1,1);
p8=(2,0);
p16=(1,0);
p24=(0,0);
p32=(3,-1);
p40=(2,-1);
p48=(1,-1);
p56=(2,-2);
transform r; r=identity rotatedaround ((1.5,1.5),90);

for i=0 step 8 until 56:
 p[i+2]=p[i] transformed r;
 p[i+6]=p[i+2] transformed r;
 p[i+5]=p[i+6] transformed r;
 p[i+1]=p[i] shifted (4,4);
 p[i+3]=p[i+2] shifted (4,4);
 p[i+7]=p[i+6] shifted (4,4);
 p[i+4]=p[i+5] shifted (4,4);
 endfor

w#:=8/pt; % that's 8 pixels
font_quad:=w#; designsize:=8w#;

picture prevchar; prevchar=nullpicture; % the pixels blackened so far
for i=0 upto 64:
 beginchar(i+ASCII"0",w#,w#,0); currentpicture:=prevchar;
 if i>0: addto currentpicture also unitpixel shifted p[i-1]; fi
 prevchar:=currentpicture; endchar;
 endfor